﻿Public Class topXProcessesControl


    Private Sub topXProcessesControl_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Dim process As New Process
        Dim count As Integer = 0
        ListView1.Items.Clear()
        For Each process In process.GetProcesses(My.Computer.Name)
            On Error Resume Next
            ListView1.Items.Add(process.ProcessName)
            ListView1.Items(count).SubItems.Add(FormatNumber(Math.Round(process.PrivateMemorySize64 / 1024), 0))
            ListView1.Items(count).SubItems.Add(process.Responding)
            ListView1.Items(count).SubItems.Add(process.Id)
            count += 1
        Next
        ToolStripStatusLabel1.Text = "processes:" & ListView1.Items.Count
    End Sub
End Class
